"use strict";
// 1. 数字枚举
var Color;
(function (Color) {
    Color[Color["Red"] = 1] = "Red";
    Color[Color["Green"] = 2] = "Green";
    Color["Blue"] = "4";
})(Color || (Color = {}));
// 正向映射： key -> value
var c1 = Color.Green;
var c2 = Color.Blue;
console.log('c1:', c1, 'c2:', c2); // c1: 2 c2: '4'
// 反向映射： value -> key
var c1Name = Color[1];
var c2Name = Color[Color.Green];
console.log('c1Name:', c1Name); // Red
console.log('c2Name:', c2Name); // Green
// 2. 字符串枚举
var bgc;
(function (bgc) {
    bgc["skyblue"] = "sb";
    bgc["rosered"] = "rr";
    bgc["highgray"] = "hg";
    bgc["grassgreen"] = "gg";
})(bgc || (bgc = {}));
var bgc1 = bgc.skyblue;
console.log('bgc1', bgc1); // 'sb'
// 3. 枚举可扩展，同样叫bgc
(function (bgc) {
    bgc[bgc["DarkRed"] = 3] = "DarkRed";
    bgc[bgc["DarkGreen"] = 4] = "DarkGreen";
    bgc[bgc["DarkBlue"] = 5] = "DarkBlue";
})(bgc || (bgc = {}));
var bgc2 = bgc.DarkRed;
console.log('bgc2', bgc2); // bgc2 3
var state1 = 1 /* success */;
console.log(state1);
